package com.glorious.controller;


import com.glorious.constant.SecurityConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@Slf4j
@Api(value = "/gateway/api", tags = {"gateway"})
@RequestMapping("/gateway/api")
@RestController
@AllArgsConstructor
public class GatewayTestController {

    @PostMapping("/getHeader")
    @ApiOperation(value = "getHeader")
    public Mono<String> getHeader(@RequestHeader(SecurityConstants.AUTHORIZATION_KEY) String authorization) {
        log.info("获取authorization: [{}]", authorization);
        return Mono.just(authorization);
    }
}
